/**
 * Created by qintao30057 on 2016/11/30.
 */
$(document).ready(function() {

});

function doOnFormInit() {
    if (typeof editForm != 'object') return;

    var degree_combo = editForm.getCombo('degree');
    degree_combo.addOption(parent.logTypeComboData);
    degree_combo.deleteOption("");
    degree_combo.readonly(true);

    var gmtCreate = editForm.getCalendar('gmtCreate');
    gmtCreate.setDateFormat("%Y-%m-%d %H:%i:%s");
    gmtCreate.showTime();
    $('input[name=gmtCreate]').attr('readonly',true);

    editForm.setReadonly('tradeId',true) ;
    editForm.setReadonly('degree',true) ;
    editForm.setReadonly('operator',true) ;
    editForm.setReadonly('bizData',true) ;
    editForm.setReadonly('stackInfo',true) ;

    editForm.disableItem("gmtCreate");
    editForm.disableItem("degree");

    doOnFormEditInit1();
}

function doOnFormEditInit1() {
    if (!parent.oneLogInfo || !parent.oneLogInfo.id) return;
    if (parent.oneLogInfo.trade_id) {
        editForm.setItemValue('tradeId', escape2Html(parent.oneLogInfo.trade_id));
    }
    editForm.setItemValue("degree", parent.oneLogInfo.degree);
    editForm.setItemValue("operator", parent.oneLogInfo.operator);
    if (parent.oneLogInfo.biz_data) {
        editForm.setItemValue("bizData", escape2Html(parent.oneLogInfo.biz_data));
    }
    if (parent.oneLogInfo.stack_info) {
        editForm.setItemValue("stackInfo", escape2Html(parent.oneLogInfo.stack_info));
    }

    var gmtCreate = editForm.getInput('gmtCreate');
    editForm.setItemValue("gmtCreate",new Date(parent.oneLogInfo.gmt_create));
    gmtCreate.value=parent.oneLogInfo.gmt_create;
}


